home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / BOK001.QM < prev    next >
Text File  |  1991-08-26  |  45KB  |  809 lines

  1. *                               BOK001.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See BOOKxx.QM For Use ]
  4. *                                8/26/91
  5. *  Key    Subfile              Description
  6. * =====  =========  =====================================================
  7. * @(f)            --Jump From Index Line To Macro (Encrypted)
  8. * @(p)            --Decrypt Macro @f
  9. *
  10. * @(6)            --Select Txtfile To Load And Read Macros From Index
  11. * @(7)            --Select And Read Macros From Index,
  12. *                       Txtfile Not Loaded
  13. * @(8)            --Read Macros of Subfile on Cursor Line,
  14. *                       Txtfile Not Loaded
  15. * @(0)            --Save Current Macro Buffer And
  16. *                       Read Previously Saved Macro Buffer
  17. * @(eq) @=        --Read Current Txtfile's Macros
  18. * @(mi) @-        --Read Previously Saved Macro Buffer
  19. * ^(f1)           --Cycle Between Starting and Selected Files
  20. *                       After Invoking @f and @6
  21. *
  22. *   {e:\up\BOOK19}--Return to BOOKxx.QM
  23. *
  24. * (Decrypt) @f - How to
  25. * (Run)     How to run @f
  26. * (Index)   Modification and Additions
  27. * (QConfig) Fitting @f Into QConfig.dat and Setup
  28. * (NewKey)  Using @f with NewKey
  29. *
  30. *-- eoi (end of Index) 
  31.  
  32.  
  33. * 
  34. * ----------------------------------------------------------------------
  35. * @(6)    Select Txtfile To Load And Read Macros From Index
  36. * ----------------------------------------------------------------------
  37.  
  38. * This macro enables the user to select a txtfile, load the selected
  39. * txtfile, and read the selected txtfiles' macros, from files listed in
  40. * INDXxx.QM.  To run, press @6, cursordown to the desired line in
  41. * INDXxx.QM, and press <enter>.  If the Index subfile selected itself
  42. * has subfile(s), the user may select the desired subfile at the next
  43. * pause by placing the cursor on the desired line and pressing <enter>.
  44. * The macro ends with the final selected txtfile loaded and it's macros
  45. * read.  To reload the macro buffer that existed before @6 was invoked,
  46. * use @0.  To cycle between the selected txtfile and the file in which
  47. * @6 was invoked, use ^f1.  Add closewindow line if QConfig is
  48. * configured to not close window on quit.
  49.  
  50. @6 macrobegin
  51. * ---------- Clear Scratch Buffers, Position Files In Ring ----------*
  52.         onewindow                       * Close all windows
  53.         unmarkblock                     * Unmark any marked blocks
  54.         defaultwordset                  * In case altwordset on
  55.         endline                         * Position on empty space
  56.         dropanchor                      * Mark starting file to clear scratch
  57.                                         * buffers and return to after "quit"
  58.         storescrbuff "1" return         * Clear buff 1 (subfile key)
  59.         storescrbuff "x" return         * Clear buff x (INDXxx,QM key)
  60.         editfile                        * Load INDX*.QM
  61.                                         *************************************
  62.             "e:\up\"                    * Change "e:\up\" to your directory *
  63.                                         *************************************
  64.             "INDX*.QM"                  *
  65.              return                     *
  66.         quit                            * Quit INDX* if loaded to ensure
  67.                                         * correct position in ring
  68.         gotoblockbeg                    * Return to starting file
  69.         begline                         * Col 1
  70. * ---------------- INDX Selection With Key In Index ----------------*
  71.         editfile return                 * Load INDX*.QM as next file in ring
  72.         markline markline               * Highlight line 1
  73.         FIND "{" return delline return  * Put cursor on first Index subfile
  74.         makectrofscreen                 * Show top of file
  75.         begline                         * Position for selection
  76.         cursorright                     * Position for visibilty
  77.         pause                           * Pause for Index selection
  78.         unmarkblock                     * Unmark line 1
  79.         markline                        * Mark selected line
  80.         FIND "(" return "L" return      * Test if selection has key
  81.  jfalse NOKEY:                          * If no key, must be subfile selec
  82.         cursorright                     *ELSE put cursor on key
  83.         markword                        * Mark key
  84.         storescrbuff "x" return         * Store key to buff x
  85.         markline                        * Mark selected line
  86.  NOKEY:                                 *
  87.         begline                         * For Find
  88.         Find "{" return "L" return      * Test if selection has subfile
  89.  jtrue HASSUB:                          * If selec has subfile, go to HASSUB
  90.         quit                            * No subfile in selection, quit INDX
  91.  jump END:                              * End macro
  92. * --------------- INDX Selection Without Key In Index ---------------*
  93.  HASSUB:
  94.         cursorright                     * Move to first letter of subfile
  95.         unmarkblock                     * Unmark
  96.         markcharacter                   * Begin character block
  97.         Find "}" return delline return  * Mark subfile prefix
  98.         copy                            * Copy subfile prefix to scrap
  99.         quit                            * Quit INDX*.QM
  100. * --------------------------- Load Subfile ---------------------------*
  101.         horizontalwindow                * Window 2
  102.         editfile paste ".qm" return     * Load subfile in window 2
  103.         begfile                         * Go to subfile begin
  104. * -------------------------- Nul Control I --------------------------*
  105.         horizontalwindow                * Window 3
  106.         editfile "NUL" return           * Load NUL in window 3
  107.         writeblock                      * Needed for macrowrite "y"
  108.             "c:\1.mac" return return    *
  109.         writeblock                      * Needed for macrowrite "y"
  110.             "c:\2.mac" return return    *
  111.         getscrbuff "x" return           * Get INDX key from scratch
  112.         endline                         * Test if INDX selection had key
  113.  jfalse NEXTSUB:                        * If no key, go to NEXTSUB
  114.         cut                             *ELSE cut key to scrap
  115.         prevwindow                      * Window subfile
  116.         endpara                         * Bypass Index
  117.         cursordown                      * Position for FIND
  118.  jump KEY:                              * Find key in subfile
  119. * --------------------- Subfile Index Selection ---------------------*
  120.  NEXTSUB:
  121.         prevwindow                      * Window subfile
  122.         markline markline               * Highlight line 1
  123.         zoomwindow                      * Full window
  124.         FIND "(" return delline return  * Find first Index selection line
  125.         makectrofscreen                 * Show top of file
  126.         begline
  127.         cursorright                     * Position for visibilty
  128.         pause                           * Pause for Index selection
  129.         zoomwindow                      * Half window
  130.         unmarkblock                     * Unmark line 1
  131.         begline                         * Re-position cursor
  132.         wordright markword              * Mark key
  133.  jfalse NEXT:                           * Bypass until NEXT if no word to mark
  134.         storescrbuff "1" return         * Store key in buffer 1
  135.         markline                        *
  136.         Find "{" return "L" return      * Test if selection has subfile
  137.  jfalse NEXT:                           * Bypass until NEXT if no subfile
  138.         cursorright                     *
  139.         unmarkblock                     *
  140.         markcharacter                   *
  141.         Find "}" return delline return  *
  142.         copy                            * Copy subfile prefix to scrap
  143. * ------------------------- Load Subfile II -------------------------*
  144.         horizontalwindow                * Window 2
  145.         editfile paste ".qm" return     * Load subfile in window
  146.  NEXT:                                  *
  147. * -------------------------- NUL Control II ---------------------------*
  148.         nextwindow                      * Window 3 NUL
  149.         getscrbuff "1" return           * Get key from scratch
  150.         cut                             * Cut key to scrap
  151. * ----------------------- Subfile II Selection -----------------------*
  152.         prevwindow                      * Window subfile
  153.         begfile                         * In case file already loaded
  154.         endpara                         * Bypass Index
  155.         scrollup                        * Put key on line 2
  156.  KEY:
  157.         Find "(" paste ")" return       * Find key in subfile
  158.         "I" return                      *
  159.  jtrue FOUND:                           * If key found, go to FOUND
  160.         begfile                         *ELSE key not found, return to bof
  161.  FOUND:                                 *
  162.         begline                         * Col 1
  163. * ----------------------------- Quit NUL -----------------------------*
  164.         nextwindow                      * Window NUL
  165.         quit                            * Quit NUL, closes window if
  166.                                         *  QConfig set to close on quit
  167. *       closewindow                     * Add this line if QConfig set
  168.                                         *  to NOT close window on quit
  169.         zoomwindow                      * Full subfile window
  170. * --------- Save Current Macro Buffer, Read Selected Macros ---------*
  171.  READ:                                  *
  172.         macrowrite                      *
  173.             "c:\1.mac" return "y"       * Save current macro buffer
  174.         macroread                       * Read subfile macros
  175.             currentfilename             *  of current file
  176.             backspace backspace         *  remove extension 'qm'
  177.             "mac" return                *  w/extension 'mac'
  178.  END:                                   *
  179. *
  180. * 198 bytes Mon  07-29-1991  10:24:51 (TH @6, Initial in AMAC39A)
  181. * 298 bytes Fri  08-02-1991  14:59:35 (TH @6, added macrowrite)
  182.  
  183.  
  184. * 
  185. * ----------------------------------------------------------------------
  186. * @(7)    Select And Read Macros From Index, Txtfile Not Loaded
  187. * ----------------------------------------------------------------------
  188.  
  189. * This macro enables the user to select and read a txtfiles' macros
  190. * from files listed in INDXxx.QM, and return to the file in which @7
  191. * was invoked with the newly loaded macros.  The txtfile of macros
  192. * selected is NOT loaded.  To run, press @7, cursordown to the desired
  193. * line in INDXxx.QM, and press <enter>.  If the subfile selected itself
  194. * has subfile(s), the user may select the desired subfile at the next
  195. * pause by placing the cursor on the desired line and pressing <enter>.
  196. * The macro ends with the file loaded in which @7 was invoked, and the
  197. * selected macros read and loaded.  To reload the macro buffer that
  198. * existed before @7 was invoked, use @0.  Add the two closewindow lines
  199. * at end of @7 if QConfig is configured to not close window on quit.
  200.  
  201. @7 macrobegin
  202. * ---------- Clear Scratch Buffers, Position Files In Ring ----------*
  203.         onewindow                       * Close all windows
  204.         unmarkblock                     * Unmark any marked blocks
  205.         defaultwordset                  * In case altwordset on
  206.         endline                         * Position on empty space
  207.         dropanchor                      * Mark starting file to clear scratch
  208.                                         * buffers and return to after "quit"
  209.         storescrbuff "x" return         * Clear buff x
  210.         editfile                        * Load INDX*.QM
  211.                                         *************************************
  212.             "e:\up\"                    * Change "e:\up\" to your directory *
  213.                                         *************************************
  214.             "INDX*.QM"                  *
  215.              return                     *
  216.         quit                            * Quit INDX*.QM if loaded to ensure
  217.                                         * correct position in ring
  218.         gotoblockbeg                    * Return to starting file
  219.         begline                         * Col 1
  220. * -------------------------- INDX Selection --------------------------*
  221.         editfile return                 * Load INDX11 as next file in ring
  222.         begfile                         * Go to file begin
  223.         markline markline               * Highlight line 1
  224.         FIND "{" return delline return  * Find first Index selection line
  225.         makectrofscreen                 * Show top of file
  226.         begline                         * Position for selection
  227.         cursorright                     * Position for visibilty
  228.         pause                           * Pause for Index selection
  229.         unmarkblock                     * Unmark line 1
  230.         markline                        * Mark selected line
  231.         FIND "(" return "L" return      * Test if selection has key
  232.  jfalse NOKEY:                          * If no key, must be subfile selec
  233.         cursorright                     *ELSE put cursor on key
  234.         markword                        * Mark key
  235.         storescrbuff "x" return         * Store key to buff x
  236.  NOKEY:                                 *
  237.         begline                         * For Find
  238.         markline                        * Markline for Find
  239.         Find "{" return "L" return      * Move cursor to subfile lft brace
  240.  jtrue SELECT:                          * If no subfile, quit and end
  241.         quit                            * Quit INDX
  242.  jump END:                              * End macro
  243.  SELECT:
  244.         cursorright                     * Move to first letter of subfile
  245.         unmarkblock                     * Unmark
  246.         markcharacter                   * Begin character block
  247.         Find "}" return delline return  * Mark subfile prefix
  248.         copy                            * Copy subfile prefix to scrap
  249.         quit                            * Quit INDX11
  250. * ----------------------- Setup Subfile Window ----------------------*
  251.         horizontalwindow                * Window 2
  252.         editfile escape                 * For all QConfig's
  253. * --------------------------- NUL Control ---------------------------*
  254.         horizontalwindow                * Window 3
  255.         editfile "NUL" return           * Load NUL in window 3
  256.         writeblock                      * Needed for macrowrite "y"
  257.             "c:\1.mac" return return    *
  258.         writeblock                      * Needed for macrowrite "y"
  259.             "c:\2.mac" return return    *
  260.         getscrbuff "x" return           * Get INDX key from scratch
  261.         endline                         * Test if INDX selection had key
  262.  jtrue QUIT:                            * If no key, go to QUIT
  263. * --------------------- Subfile Index Selection ---------------------*
  264.         prevwindow                      * Window 2 subfile
  265.         editfile paste ".qm" return     * Load subfile window 2
  266.         begfile                         * Go to file begin
  267.         markline markline               * Highlight line 1
  268. *         zoomwindow                      * Full window
  269.         FIND "{" return delline return  * Test if selection has any subfiles
  270.                                         * If so, position cursor on first line
  271.  jfalse QUITNUL:                        * If not, read current file macros
  272. *         makectrofscreen                 * Show top of file
  273.         begline                         * Position for selection
  274.         cursorright                     * Position for visibilty
  275.         zoomwindow                      * Full window                     |a
  276.         makectrofscreen                 * Show top of file                |b
  277.         pause                           * Pause for Index selection
  278.         unmarkblock                     * Unmark line 1
  279.         markline                        * Mark selected line
  280.         Find return "L" return          * Test if selection has subfile
  281.  jfalse QUITNUL:                        * If not, read current file macros
  282.         cursorright                     * Move to first letter of subfile
  283.         unmarkblock                     * Unmark
  284.         markcharacter                   * Begin character block
  285.         Find "}" return delline return  * Mark subfile prefix
  286.         copy                            * Copy subfile prefix to scrap
  287. * ----------------------------- Quit NUL -----------------------------*
  288.  QUITNUL:
  289.         quit                            * Quit subfile, closes window if
  290.                                         *  QConfig set to close on quit
  291. *       closewindow                     * Add this line if QConfig set
  292.                                         *  to NOT close window on quit
  293.         nextwindow                      * Window NUL
  294.  QUIT:
  295.         quit                            * Quit NUL, closes window if
  296.                                         *  QConfig set to close on quit
  297. *       closewindow                     * Add this line if QConfig set
  298.                                         *  to NOT close window on quit
  299. * --------- Save Current Macro Buffer, Read Selected Macros ---------*
  300.  READ:                                  *
  301.         unmarkblock                     * Unmark line if marked
  302.         prevwindow                      * Return to starting file if
  303.                                         *  any window still open
  304.         zoomwindow                      * Full subfile window if
  305.                                         *  any window still open
  306.         macrowrite                      *
  307.             "c:\1.mac" return "y"       * Save current macro buffer
  308.         macroread                       * Read subfile macros
  309.             paste                       *  of subfile prefix
  310.             ".mac" return               *  w/extension 'mac'
  311.  END:                                   *
  312. *
  313. * 136 bytes Mon  07-29-1991  10:24:57 (TH @7, Initial in AMAC39A)
  314. * 256 bytes Fri  08-02-1991  14:59:02 (TH @7, added macrowrite)
  315. * 249 bytes Sat  08-03-1991  15:45:28 (TH @7, added macrowrite)
  316. * 248 bytes Sun  08-04-1991  01:41:24 (TH @7, removed unmarkblock)
  317. *                   (In AMACxx v4.0)
  318. * 248 bytes Mon  08-05-1991  00:50:00 (TH @7, moved zoomwindow down |a)
  319. * 248 bytes Mon  08-05-1991  14:24:16 (TH @7, moved makectrofscreen down |b)
  320.  
  321.  
  322.  
  323. * 
  324. * ----------------------------------------------------------------------
  325. * @(8) Read Macros of Subfile on Cursor Line, Txtfile Not Loaded
  326. * ----------------------------------------------------------------------
  327.  
  328. * This macro enables the user to read macros of the subfile designated
  329. * on the cursor line but not load it's txtfile.  If the subfile on the
  330. * cursor line itself has subfile(s), the user may select the desired
  331. * subfile at the next pause by placing the cursor on the desired line
  332. * and pressing <enter>.  If the starting cursor line does not contain a
  333. * designated subfile, the macro ends with the macro buffer unchanged
  334. * and cursor on the starting line in col 1.  In all cases, the txtfile
  335. * of selected macro is NOT loaded and the user is returned to the file
  336. * @8 was invoked from with selected macros loaded.  To reload the macro
  337. * buffer that existed before @8 was invoked, invoke @0.  Add the two
  338. * closewindow lines at end of this macro if QConfig is configured to
  339. * not close window on quit.
  340.  
  341. @8 macrobegin
  342. * ---------- Clear Scratch Buffers, Position Files In Ring ----------*
  343.         onewindow                       * Close all windows
  344.         unmarkblock                     * Unmark any marked blocks
  345.         defaultwordset                  * In case altwordset on
  346.         endline                         * Position on empty space
  347.         dropanchor                      * Mark starting file to clear scratch
  348.                                         * buffers and return to after "quit"
  349.         storescrbuff "1" return         * Clear buff 1
  350.         begline                         * Position for selection
  351.         markline                        * Mark selected line
  352.         FIND "(" return "L" return      * Test if selection has key
  353.  jfalse NOKEY:                          * If no key, must be subfile selec
  354.         cursorright                     *ELSE put cursor on key
  355.         markword                        * Mark key
  356.         storescrbuff "1" return         * Store key to buff 1
  357.  NOKEY:                                 *
  358.         begline                         * For Find
  359.         markline                        * Markline for Find
  360.         Find "{" return "L" return      * Move cursor to subfile lft brace
  361.  jtrue SELECT:                          * If subfile, continue
  362.         unmarkblock                     *ELSE unmark line
  363.  jump END:                              * And end macro, no macro to read
  364.  SELECT:
  365.         cursorright                     * Move to first letter of subfile
  366.         unmarkblock                     * Unmark
  367.         markcharacter                   * Begin character block
  368.         Find "}" return delline return  * Mark subfile prefix
  369.         copy                            * Copy subfile prefix to scrap
  370.         begline                         * Col 1
  371. * ----------------------- Setup Subfile Window ----------------------*
  372.         horizontalwindow                * Window 2
  373.         editfile escape                 * Needed for all QConfig's
  374. * --------------------------- NUL Control ---------------------------*
  375.         horizontalwindow                * Window 3
  376.         editfile "NUL" return           * Load NUL in window 3
  377.         writeblock                      * Needed for macrowrite "y"
  378.             "c:\1.mac" return return    *
  379.         writeblock                      * Needed for macrowrite "y"
  380.             "c:\2.mac" return return    *
  381.         getscrbuff "1" return           * Get key from buff 1
  382.         endline                         * Test if selection had key       |a
  383.  jtrue QUIT:                            * If no key, go to QUIT
  384. * --------------------- Subfile Index Selection ---------------------*
  385.         prevwindow                      * Window 2 subfile
  386.         editfile paste ".qm" return     * Load subfile window 2 to test if
  387.                                         *  it has subfiles
  388.         begfile                         * Go to file begin
  389.         markline markline               * Highlight line 1
  390. *         zoomwindow                      * Full window
  391.         FIND "{" return delline return  * Test if selection has any subfiles
  392.                                         * If so, position cursor on first line
  393.  jfalse QUITNUL:                        * If not, read current file macros
  394.         begline                         * Position for selection
  395.         cursorright                     * Position for visibilty
  396.         zoomwindow                      * Full window                     |a
  397.         makectrofscreen                 * To show top of file             |a
  398.         pause                           * Pause for Index selection
  399.         unmarkblock                     * Unmark line 1
  400.         markline                        * Mark selected line
  401.         Find return "L" return          * Test if selection has subfile
  402.  jfalse QUITNUL:                        * If not, read current file macros
  403.         cursorright                     * Move to first letter of subfile
  404.         unmarkblock                     * Unmark
  405.         markcharacter                   * Begin character block
  406.         Find "}" return delline return  * Mark subfile prefix
  407.         copy                            * Copy subfile prefix to scrap
  408.         begline                         * Col 1
  409. * ----------------------------- Quit NUL -----------------------------*
  410.  QUITNUL:
  411.         quit                            * Quit subfile, closes window if
  412.                                         *  QConfig set to close on quit
  413. *       closewindow                     * Add this line if QConfig set
  414.                                         *  to NOT close window on quit
  415.         nextwindow                      * Window NUL
  416.  QUIT:
  417.         quit                            * Quit NUL, closes window if
  418.                                         *  QConfig set to close on quit
  419. *       closewindow                     * Add this line if QConfig set
  420.                                         *  to NOT close window on quit
  421. * --------- Save Current Macro Buffer, Read Selected Macros ---------*
  422.  READ:                                  *
  423.         prevwindow                      * Return to starting file
  424.         zoomwindow                      * Full subfile window
  425.         macrowrite                      *
  426.             "c:\1.mac" return "y"       * Save current macro buffer
  427.         macroread                       * Read subfile macros
  428.             paste                       *  of subfile prefix
  429.             ".mac" return               *  w/extension 'mac'
  430.  END:                                   *
  431. *
  432. * 198 bytes Sun  08-04-1991  01:53:24 (TH @8)
  433. * 200 bytes Mon  08-05-1991  01:06:52 (TH @8, added missing endline, et al |a)
  434.  
  435.  
  436. * 
  437. * ----------------------------------------------------------------------
  438. * @(f)   Jump From Index Line To Macro or Item Located Either
  439. *        In Document Below Or In A Designated Subfile
  440. * ----------------------------------------------------------------------
  441.  
  442. * NOTE:  The first three lines of this macro must be decrypted to run.
  443. *        See @p at the end of this file for decryption instructions.
  444.  
  445. *        @f is used to quickly jump from Index line to the desired item
  446. *        or macro either in the document below or in a subfile whose
  447. *        name appears in { } following the key or item in ( ).  @f uses
  448. *        a technique that is generally not recommended and rarely
  449. *        works, i.e.  "having a macro read another macro".  This is
  450. *        possible here because the macroread command is the last
  451. *        command in the macro.
  452.  
  453. *        @f provides the user with a means to quickly load any macro in
  454. *        an Index with just several keystrokes.  The number of macros
  455. *        that can be accessed and run using this macro is theoretically
  456. *        unlimited; e.g., if no macro subfile of all those designated
  457. *        in the Index contains more than 10 macros and an Index with
  458. *        key and subfile contains a list of 1000 macros, each of these
  459. *        macros could be assigned @1 to @0 in each subfile, and we
  460. *        could access and run 1000 macros using only the keys @1 to @0
  461. *        from one Index with just several keystrokes.  Another
  462. *        advantage using @f is that an addition or modification to a
  463. *        specific macro only modifies the subfile containing the macro
  464. *        and it's macfile, thereby reducing considerably the size of
  465. *        files needing backed up or uploaded when changes are made.
  466.  
  467. *        The techniques used in @f become useful and/or necessary when
  468. *        the total size of macros in a file exceed the 2k limitation or
  469. *        when the number of macros in a file are greater than 40 and
  470. *        the user (like me!) prefers to use only the Alternate Number
  471. *        keys and "@^#" Function keys.  The same macro key may be used
  472. *        for different macros in different subfiles in the same Index,
  473. *        allowing the convenient Alternate Number keys to be used for
  474. *        all macros in all subfiles, unless the number of macros in any
  475. *        subfile of an Index is greater than 10.  In other words, we
  476. *        don't run out of keys!
  477.  
  478. *        The user may wish to add or delete items from an (Index).  An
  479. *        item or macro located in the same file as the Index, not in a
  480. *        subfile, must have the key or first word enclosed with
  481. *        parentheses ( ) and an item or macro located in another file
  482. *        (referred to as "subfile") must have the subfile prefix
  483. *        enclosed with braces { } following the macro key, as follows:
  484.  
  485. *                                 Index
  486. *        ============================================================
  487. *         ( Key )  { Subfile }-- ........... Description ............
  488.  
  489. *        All subfile suffix's must be "QM", and all macfile suffix's
  490. *        must be "MAC".  If the designated subfile does not have a
  491. *        corresponding macfile, the selected item will be found in the
  492. *        subfile anyhow, and an error message will be displayed
  493. *        advising "File Not Found" meaning the subfile does not have a
  494. *        corresponding macfile.  Escape removes the message and shows
  495. *        the name of the non-existent subfile macfile.  Escape again
  496. *        returns us to normal editing of the subfile with the same
  497. *        macro buffer as before @f was executed - no problems.
  498.  
  499. *        If the selected key or first word on the selected Index line
  500. *        does not exist enclosed by ( ) anywhere in the document (or in
  501. *        the subfile if designated), the cursor returns to the
  502. *        beginning of the file.
  503.  
  504. *        If a subfile is designated and the current file happens to be
  505. *        the designated subfile, @f functions the same as @1, i.e.  the
  506. *        selected macro is found and macro buffer remains unchanged.
  507.  
  508. *        If a subfile is not designated (like in the Index line @f at
  509. *        the top), @f also functions the same as @1.  If a key is not
  510. *        designated (like in the Index line at the top to return to
  511. *        BOOKxx.QM), the macro attempts to find the first word on the
  512. *        Index line and returns the cursor to the top of file if the
  513. *        first word on the Index line cannot be found enclosed in ( ).
  514.  
  515. *        @f does not reads macros of the current file if no subfile
  516. *        macros are designated.  It does, however, read subfile macros
  517. *        if a subfile is designated.  To reload the macro buffer that
  518. *        existed before @f was invoked, invoke @0.
  519.  
  520. *        Fit @f In (Qconfig) And Setup ------------------------------
  521. *        @f will not fit in QConfig.dat, but we can use a little known
  522. *        or used trick to accomplish the same thing.  Put the following
  523. *        macro in QConfig.dat with [dir:] as your directory for
  524. *        bok001.mac:
  525.  
  526. *            @f macro_begin macroread "[dir:]bok001.mac" return
  527.  
  528. *        where [dir:] is your directory containing 'bok001.mac'.  This
  529. *        QConfig macro key does not have to be @f, but can be any key
  530. *        the user desires.  This macro only loads book001.mac macros,
  531. *        but if they are already loaded, the key will invoke the
  532. *        specific exisiting book001 macro, e.g., @f would invoke @f
  533. *        after book001 macros are loaded.
  534.  
  535. *        Invoking @f once loads bok001.mac containing @f.  Now @f is
  536. *        available until any other macros are read.  Pressing @f a
  537. *        second time, and any time thereafter, executes @f.  I prefer
  538. *        the NewKey approach below because of the 0.5k QConfig.dat
  539. *        limitation.  I have numerous macros available to run at all
  540. *        times, each as a separate NewKey macro, and loads to free
  541. *        Qconfig buffer space.
  542.  
  543. *        If your QConfig is set to NOT close windows on quit, add the
  544. *        line 'closewindow' commented out in @f.
  545.  
  546. *        Using @f With (NewKey)
  547. *        ----------------------
  548. *        An alternative to the above QConfig approach is to use the
  549. *        following NewKey macro with the key Alternate CursorLeft
  550. *        key:
  551.  
  552. *            * Load And Read Macros From An Index Invoking @f
  553. *            {begdef altlft}<esc>MRe:\up\bok001.mac<enter>
  554. *            <altf>
  555. *            {enddef}
  556.  
  557. *        With this NewKey approach, @f is always available at all times
  558. *        using the handy ^cursorlft key to be invoked in any QEdit file
  559. *        no matter what macros are loaded in the QEdit buffers.  The
  560. *        NewKey approach has one further advantage over the QConfig
  561. *        approach: we can not only use a NewKey macro to read a QEdit
  562. *        macro, but the same NewKey macro can call or execute a macro
  563. *        of the newly read QEdit macro - e.g., @f is executed after
  564. *        bok001.mac is read.  The QConfig approach requires two steps
  565. *        to achieve the same thing.  Be sure to also change 'e:\up' in
  566. *        the NewKey macro to your directory containing 'bok001.mac' as
  567. *        described in the Configuration Section of BOOKxx.QM.
  568.  
  569. *        The following macros may also be substituted with NewKey
  570. *        macros using the user's specific QConfig.dat commands for each
  571. *        macro command as above, thereby eliminating the need to put
  572. *        any of the macros in QConfig.dat for macro accesability at all
  573. *        times:
  574.  
  575. *        ^f1  Cycle Between Starting and Selected Files After Invoking macro
  576. *        @0   Save Current Macro Buffer, Read Previously Saved Macro Buffer
  577. *        @=   Read Current Txtfile Macros
  578. *        @-   Read Previously Saved Macro Buffer
  579.  
  580.  
  581. *        To (Run) @f
  582. *        -----------
  583. *        1. Press Alt and f at the same time. Line 1 is marked to
  584. *           highlight. Cursor down to desired line in Index.
  585. *
  586. *        2. Press Enter. The macro then locates and jumps to the item
  587. *           selected on the cursor line. If the item or macro is
  588. *           located in a designated subfile, @f loads the subfile
  589. *           containing the selected macro, and reads the subfile macros
  590. *           for running. The selected macro key and it's macro are
  591. *           found and shown in a full window for editing or viewing.
  592.  
  593. * 
  594. @f macrobegin
  595. *--
  596. * NOTE:  The first three lines of this macro must be decrypted to run.
  597. *        See @p at the end of this file for instructions.
  598. *--
  599. *ööδùÅ¢ÇùéüεöµÅâôÇÄÅö≡ùé≤ÇùÅöîùΘ∩äƵÄüñÆöτäü·⌠ùñåüäöò÷üäÅòñäÿßëëö"æ"öàÅ÷ßäù
  600. *ööò÷üäÅòñäÿßëëö"Σ"öàÅ÷ßäùöτÅë∩ßÄ÷¢üäéòÅ÷öîùΘ∩äƵÄüñÆö≥∩äÆ≤ÇùÅö≥∩äÆ≤ÇùÅöôÇùé
  601. *öö"("öàÅ÷ßäùöτÅÄ≤ÇùÅöàÅ÷ßäùö≥∩ÆÅΦ÷äδëòñäÅÅùöµÅâ≤ÇùÅöΦßäÖüäàÇâå÷öì∩ßÖÅ
  602. *--
  603.         unmarkblock                     * Unmark line 1
  604.         begline                         * To find first {                    |
  605.         markline                        * Mark selected line
  606.         Find "{" return "L" return      * Test if selection has subfile
  607.  jtrue SUBFILE:                         * If "{" found, macro is in subfile
  608. * ------------- Find Index Selection If In Current File -------------*
  609.  INFILE:                                * If not found, macro is in this file
  610.         unmarkblock                     * Just in case                       |
  611.         wordright markword              * Mark key
  612.         copy                            * Copy key to scrap
  613.         endpara                         * Bypass Index
  614.         Find "(" paste ")" return       *
  615.         "I" return                      * Jump to key in this file
  616.  jfalse NOMARK:                         *
  617.         maketopofscreen                 *
  618.         scrollup                        * Position cursor line 2 tof
  619.         begline                         * If key found, go to begline
  620.  jump END:                              * Macfile not read
  621.  NOMARK:                                *
  622.         begfile                         * If no key found, go to begfile
  623.  jump END:                              * Macfile not read
  624. * ---------------- Find Index Selection If In Subfile ----------------*
  625.  SUBFILE:                               * Come here if macro in subfile
  626.         begline                         * Re-position cursor
  627.         unmarkblock                     * Just in case                       |
  628.         wordright markword              * Mark key
  629.  jfalse NEXT:                           * Bypass buffers if no word to mark
  630.         storescrbuff "x" return         * Store key in buff x
  631.         markline                        * Markline for Find
  632.         begline                         * Re-position for Find
  633.         Find "{" return "L" return      * Test if selection has subfile
  634.  jfalse NEXT:                           * Bypass buffers if no subfile
  635.         cursorright                     * Move to first letter of subfile
  636.         unmarkblock                     * Unmark
  637.         markcharacter                   * Begin character block
  638.         Find "}" return delline return  * Mark subfile prefix
  639.         storescrbuff "y" return         * Store subfile prefix in buff y
  640.         copy                            * Copy subfile prefix to scrap
  641. * --------------------------- Load Subfile ---------------------------*
  642.         horizontalwindow                * Window 2
  643.         editfile paste ".qm" return     * Load subfile in window 2
  644.  NEXT:
  645. * --------------------------- NUL Control ---------------------------*
  646.         horizontalwindow                * Window 3
  647.         editfile "NUL" return           * Load NUL in window 3
  648.         writeblock                      * Needed for macrowrite "y"
  649.             "c:\1.mac" return return    *
  650.         writeblock                      * Needed for macrowrite "y"
  651.             "c:\2.mac" return return    *
  652.         getscrbuff "x" return           * Get key from scratch
  653.         cut                             * Cut key to scrap
  654. * ----------------- Find Index Selection In Subfile -----------------*
  655.         prevwindow                      * Window subfile
  656.         begfile                         * Re-position for search
  657.         endpara                         * Bypass Index
  658.         Find "(" paste ")" return       * Find key in subfile
  659.         "I" return                      *
  660.  jfalse NOTFOUND:                       * If key not found, go to NOTFOUND
  661.         maketopofscreen                 *
  662.         scrollup                        * Position cursor line 2 tof
  663.         begline                         * Col 1
  664.  jump QUIT:                             * Bypass begfile
  665.  NOTFOUND:                              *
  666.         begfile                         * Key not found, cursor to bof
  667. * ----------------------------- Quit NUL -----------------------------*
  668.  QUIT:                                  *
  669.         nextwindow                      * Window NUL
  670.         quit                            * Quit NUL, closes window if
  671.                                         *  QConfig set to close on quit
  672. *       closewindow                     * Add if QConfig set to NOT close
  673.                                         *  window on quit
  674.         zoomwindow                      * Zoom starting or subfile
  675. * --------- Save Current Macro Buffer, Read Selected Macros ---------*
  676.  READ:                                  *
  677.         macrowrite                      *
  678.             "c:\1.mac" return "y"       * Save current macro buffer
  679.         macroread                       * Read subfile macros
  680.             currentfilename             *  of current file
  681.             backspace backspace         *  remove extension 'qm'
  682.             "mac" return                *  insert extension
  683.  END:                                   *
  684. *
  685. * 158 bytes Sun  07-21-1991  22:00:00 (TH @f, added use of subfiles)
  686. * 166 bytes Mon  07-29-1991  10:25:08 (TH @f, in AMAC39A)
  687. * 225 bytes Fri  08-02-1991  14:59:08 (TH @f, added macrowrite)
  688. * 228 bytes Mon  08-22-1991  16:55:43 (TH @f, for odd cases)
  689. * 201 bytes Mon  08-26-1991  11:59:20 (TH @f, encyrpted with @p)
  690.  
  691.  
  692.  
  693.  
  694. * The following four macros in bok001.qm should be installed in
  695. * QConfig.dat and then commented out of bok001.qm after installation.
  696. * they will then be available while editing any file as long as no
  697. * subsequently installed macros have the same keys.
  698.  
  699. * 
  700. * ----------------------------------------------------------------------
  701. * ^(f1)  Cycle Between Starting and Selected Files After Invoking @6
  702. * ----------------------------------------------------------------------
  703. * Installing this macro in QConfig.dat, enables the user to cycle
  704. * between the starting and selected file after invoking @6.
  705.  
  706. ^f1 macrobegin nextwindow zoomwindow
  707. *
  708. * 6 bytes Thu  08-01-1991  09:34:42 (TH ^f1)
  709.  
  710.  
  711. * 
  712. * --------------------------------------------
  713. * @(0)  Save Current Macro Buffer And
  714. *       Read Previously Saved Macro Buffer
  715. * --------------------------------------------
  716. * Installing this macro in QConfig.dat, enables the user to save the
  717. * current macro buffer, then read the previously saved macro buffer.
  718.  
  719. @0 Macro_Begin MacroWrite "c:\2.mac" Return "y" MacroRead "c:\1.mac" Return
  720. *
  721. * 42 bytes Thu  08-01-1991  00:43:24 (TH @0)
  722.  
  723.  
  724. * 
  725. * ----------------------------------------------------------------------
  726. * @= Read Current Txtfile's Macros                            @(eq)ual
  727. * ----------------------------------------------------------------------
  728. * Installing this macro in QConfig.dat, enables the user to read the
  729. * macros of the current file we are editing.
  730.  
  731. @= Macro_Begin MacroRead CurrentFilename Backspace Backspace "mac" Return
  732. *
  733. * 15 bytes Fri  09-14-1990  14:06:11 (TH @=, @8 in MACRxx.QM)
  734.  
  735.  
  736. * 
  737. * ----------------------------------------------------------------------
  738. * @- Read Previously Saved Macro Buffer                       @(mi)nus
  739. * ----------------------------------------------------------------------
  740. * Installing this macro in QConfig.dat, enables the user to read the
  741. * macros that were saved previously when @6, @7 and @f were invoked.
  742.  
  743. @- Macro_Begin MacroRead "c:\1.mac" Return
  744. *
  745. * 22 bytes Wed  07-31-1991  20:53:50 (TH @-)
  746.  
  747.  
  748. * 
  749. * -------------------------
  750. * @(p) (Decrypt) Macro @f
  751. * -------------------------
  752. *       These macros are free.  However, if you find them useful and
  753. *       would like to send me a gift for any amount, I will be glad to
  754. *       accept it.   Macro @f is by far the most useful and, although
  755. *       it's really not very complicated, it represents the culmination
  756. *       of a lot of work.  So, I don't apologize for encrypting it!
  757.  
  758. *       I'll be happy to send you the Password to decrypt @f if you
  759. *       would like to send $15.00 (or any amount) in a self-addressed
  760. *       envelope to:
  761.  
  762. *                               T & T Enterprises
  763. *                               PO Box 10786
  764. *                               Greensboro, NC 27404
  765.  
  766. *       I'll still be glad to send you the Password even if you don't
  767. *       have $15.00 or don't think these macros are worth it.  Just
  768. *       send a self addressed stamped envelope!  The 250+ AMAC macros
  769. *       have been my full time effort for the last year from which I
  770. *       have received NO income.  I didn't expect to.  I just enjoyed
  771. *       immensely this effort, but now I have to pay the bills <grin>!
  772. *       I hope you find these macros useful.
  773.  
  774. *       To decrypt @f:
  775. *           1. Mark the three encrypted lines as a line block
  776. *           2. Press @p
  777. *           3. Type Password at pause in Nul file, then <enter>
  778. *           4. Uncomment decrypted lines
  779. *           5. SaveFile and re-compile using the following command:
  780. *                   QMACB bok001 <enter>
  781.  
  782. @p      MacroBegin OneWindow GotoBlockBeg JTrue Label0: MarkLine
  783.         GotoBlockBeg JTrue Label1: Pause MarkLine Label0: Label1:
  784.         GotoBlockEnd SetRmargin Return ToggleWordWrap EndLine "¡"
  785.         BegLine GotoBlockBeg UnmarkBlock EndLine BegLine JTrue
  786.         Label2: NextPara Label2: Label13: MarkColumn EditFile "nul"
  787.         Return Quit GotoBlockBeg HorizontalWindow EditFile Return "A"
  788.         "BCDEFGHIJKLMNOPQRSTUVWXYZ" DupLine MarkLine Lower UnmarkBlock
  789.         CursorUp CursorRight JoinLine ShiftRight CursorUp "152436097"
  790.         "8" AddLine BegLine CursorRight "Ωφ∩Θñ⌠µΦτ≡ô⌡≈σ∙±≤≥°δìïàòÉîÜ¢£"
  791.         "¥₧ƒáíóúαêèöÿéÅëâåÇçÆÄùü·ûäÖ÷ßΓεæΣÑ" EndFile AddLine BegLine
  792.         Pause Label5: CursorLeft JFalse Label3: UnmarkBlock
  793.         MarkColumn Cut Find Paste Return "G" Return JFalse Label4:
  794.         DelCh BegLine CursorRight Paste EndFile Jump Label5: Label3:
  795.         DelLine PrevWindow Label11: MarkColumn Copy NextWindow
  796.         Label9: BegFile Find Paste Return DelLine Return JFalse
  797.         Label6: CursorDown JTrue Label7: CursorUp Label7: MarkColumn
  798.         Copy Label6: PrevWindow MakeCtrOfScreen PasteOver UnmarkBlock
  799.         CursorRight EndLine JFalse Label8: PrevPosition MarkColumn
  800.         Copy NextWindow Jump Label9: Label8: Find "¡" Return "B"
  801.         Return JTrue Label10: BegLine CursorDown Label12: EndLine
  802.         BegLine JTrue Label11: NextPara Jump Label12: NextWindow Quit
  803.         CloseWindow Jump Label13: Label10: DelCh BegLine CursorDown
  804.         NextWindow Label4: Quit CloseWindow SetRmargin Return
  805. *
  806. * 356 bytes Mon  08-26-1991  02:51:27 (TH @p)
  807.  
  808.  
  809.